home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_cavernshimmy.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  103 lines

  1.  
  2. # Jones 3D Cog Script
  3. #
  4. # PRU_cavernShimmy.cog    Adjust camera's position while Indy shimmies across top of cavern.
  5. #
  6. # [GGJ]
  7. #
  8. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  9. #
  10. # ========================================================================================
  11. symbols
  12.  
  13. message     entered
  14. message        exited
  15.  
  16. thing        cam1spot
  17. thing        cam1look
  18. thing        shimmyCam            local
  19. thing        player                local
  20.  
  21. sector        targetsector        local
  22. surface        shimmyhang
  23. surface        slide
  24.  
  25. template    ghostTpl=ghost        local
  26.  
  27. sound        shimmyMus=mus_gen_danger2.wav        local
  28. sound        slideMus=mus_gen_indywhip1.wav        local
  29.  
  30. vector    v_modvec                local
  31. vector    v_targetpos0            local
  32. int        once=0                    local
  33.  
  34.  
  35.  
  36. end
  37.  
  38. # ========================================================================================
  39. code
  40.  
  41. entered:
  42. player = GetLocalPlayerThing();
  43. if (GetSenderRef() == shimmyhang)
  44. {
  45.     #Create camera and target above and below Indy
  46.     v_modvec = VectorSet(0, -0.1, 0.25);
  47.     v_targetpos0 = VectorAdd(VectorTransformToOrient(player, v_modvec), GetThingPos(player));    
  48.     targetsector = FindNewSectorFromThing(player, v_targetpos0);
  49.     
  50.     shimmyCam = CreateThingAtPos(ghostTpl, targetsector, v_targetpos0, '0 0 0');
  51.     CaptureThing(shimmyCam);                 # no capture, no work
  52.     AttachThingToThing(shimmyCam, player);    # track his move
  53.     
  54.     
  55.     MakeCamera2LikeCamera1(cam1spot, cam1look);
  56.     SetCameraLookInterp(2, 0);             # force snap if not sure already the case
  57.     SetCameraPosInterp(2, 0);             # force snap if not sure already the case
  58.     SetCameraFocus(2, cam1spot);         # cam 2 takes over here
  59.     SetCameraSecondaryFocus(2, cam1look); # looking same place
  60.     AttachThingToThing(cam1look, player);
  61.     AttachThingToThing(cam1spot, player);    # track his move
  62.     #viewangle = GetCameraFOV();         # it pays to be careful
  63.     SetCurrentCamera(2);
  64.     ResetCameraFOV(0, 0.0);
  65.     #SetCameraFOV(viewangle, 0, 0.0);     # start here anyway
  66.     SetCameraLookInterp(2, 1);
  67.     SetCameraPosInterp(2, 1);
  68.     SetCameraInterpSpeed(2, 0.7);         # about right
  69.     Sleep(0.01);                         # let engine work briefly
  70.     SetCameraFocus(2, shimmyCam);         # slide out to new spot
  71.     #SetCameraSecondaryFocus(2, hangTarget); # slide over to new target
  72.     
  73.     if (once == 0)
  74.     {
  75.         PlaySoundLocal(shimmyMus, 1.0, 0.0, 0x0, 0);
  76.         once = 1;
  77.     }
  78. }
  79.  
  80. if (GetSenderRef() == slide)
  81. {
  82.     Sleep(0.75);
  83.     PlaySoundLocal(slideMus, 1.0, 0.0, 0x0, 0);
  84. }
  85. return;
  86.  
  87. exited:
  88. if (GetSenderRef() == shimmyhang)
  89. {
  90.     #SetCameraSecondaryFocus(2, cam1look);
  91.     #SetCameraFOV(viewangle, 1, 0.5); # transition back to follow-cam FOV
  92.     
  93.     SetCameraPosition(1, GetThingPos(shimmyCam));
  94.     SetCurrentCamera(1);
  95.  
  96.     SetCameraLookInterp(2, 0); # exit in snap mode
  97.     SetCameraPosInterp(2, 0); # exit in snap mode
  98.  
  99. }
  100. return;
  101. end
  102.  
  103.